Skip to content

Premium Analytics: keep the onboarding welcome modal open on a click outside - #52095

Merged
dognose24 merged 3 commits into
trunkfrom
fix/pa-onboarding-modal-outside-click
Sep 9, 2026
Merged

Premium Analytics: keep the onboarding welcome modal open on a click outside#52095
dognose24 merged 3 commits into
trunkfrom
fix/pa-onboarding-modal-outside-click

Conversation

@dognose24

Copy link
Copy Markdown
Contributor

Fixes UNI-750

Proposed changes

  • Keep the onboarding welcome modal open on a click outside it. The close button and Escape still dismiss it, and Take a quick tour still hands off to the tour.
  • Drop outside from the onboarding dismiss reasons, since the modal can no longer produce it.

Why

The onboarding opens once per reader per site, and the preference is written the moment it opens. A stray click on the backdrop therefore dismissed the modal for good, with no way back to the tour. Base UI's disablePointerDismissal on Dialog.Root keeps the backdrop click from closing it; the keyboard and the close button behave as before.

Related product discussion/links

Does this pull request change what data or activity we track or use?

No new data. The reason property on jetpack_premium_analytics_onboarding_dismiss can no longer be outside; close, escape and other are unchanged.

Testing instructions

  1. Open the new Traffic tab (Jetpack → Stats → Traffic, or the standalone Premium Analytics plugin) on a site where the onboarding has not run yet. To run it again on a site where it has, reset the preference in the browser console and reload:

    wp.data.dispatch( 'core/preferences' ).set( 'jetpack-premium-analytics/dashboard', 'onboardingCompletedAt', undefined );
  2. With the welcome modal open, click on the dimmed backdrop outside it.

    • Before: the modal closes and cannot be brought back.
    • After: the modal stays open.
  3. Press Escape, or click the close button: the modal closes, as before.

  4. Reopen (reset the preference again) and click Take a quick tour: the tour starts, as before.

  5. pnpm jetpack test js packages/premium-analytics passes; the new test covers the click outside.

🤖 Generated with Claude Code

https://claude.ai/code/session_01E6EnRKyZ6hzCb2pm7Y4tXN

…outside

A click on the backdrop dismissed the welcome modal, and since the
onboarding opens once per reader that stray click lost the tour for good.
Base UI's disablePointerDismissal keeps the modal up; the close button and
Escape still dismiss it.

Fixes UNI-750.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E6EnRKyZ6hzCb2pm7Y4tXN
@dognose24
dognose24 requested a review from a team as a code owner September 8, 2026 17:27
@dognose24 dognose24 added [Status] Needs Review This PR is ready for review. [Type] Bug labels Sep 8, 2026
@dognose24 dognose24 self-assigned this Sep 8, 2026
@dognose24 dognose24 added [Status] Needs Review This PR is ready for review. [Type] Bug labels Sep 8, 2026
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WoA dev site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin (Jetpack or WordPress.com Site Helper), and enable the fix/pa-onboarding-modal-outside-click branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack fix/pa-onboarding-modal-outside-click
bin/jetpack-downloader test jetpack-mu-wpcom-plugin fix/pa-onboarding-modal-outside-click

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

@github-actions github-actions Bot added [Package] Premium Analytics [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Plugin] Premium Analytics labels Sep 8, 2026
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

If you have questions about anything, reach out in #jetpack-developers for guidance!


Jetpack plugin:

The Jetpack plugin has different release cadences depending on the platform:

  • WordPress.com Simple releases happen as soon as you deploy your changes after merging this PR (PCYsg-Jjm-p2).
  • WoA releases happen weekly.
  • Releases to self-hosted sites happen monthly:
    • Scheduled release: October 6, 2026

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Premium Analytics plugin:

No scheduled milestone found for this plugin.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.

@jp-launch-control

Copy link
Copy Markdown

Code Coverage Summary

This PR did not change code coverage!

That could be good or bad, depending on the situation. Everything covered before, and still is? Great! Nothing was covered before? Not so great. 🤷

Full summary · PHP report · JS report

layoutd
layoutd previously approved these changes Sep 8, 2026

@layoutd layoutd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified manually following test instructions: clicking outside the modal no longer closes it, Escape and the close button still do, and the tour handoff is unchanged. The new test fails against trunk and passes here. One small DRY inline, not blocking.


/** How the reader closed the journey without finishing it. */
export type OnboardingDismissReason = 'close' | 'escape' | 'outside' | 'other';
export type OnboardingDismissReason = 'close' | 'escape' | 'other';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This union is a copy of the one in packages/ui/src/onboarding-welcome-modal/onboarding-welcome-modal.tsx:8, which meant eaditing both to make changes here.

The ui package already exports OnboardingDismissReason (packages/ui/src/index.ts:16) and stage.tsx already imports from @jetpack-premium-analytics/ui, so maybe the hook can import the type and drop its copy.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call, thanks. Done in b28ccc3: the hook now imports OnboardingDismissReason from @jetpack-premium-analytics/ui and re-exports it, so hooks/index.ts and the stage keep working unchanged and there is a single definition again.

@dognose24
dognose24 merged commit f9e7245 into trunk Sep 9, 2026
79 checks passed
@dognose24
dognose24 deleted the fix/pa-onboarding-modal-outside-click branch September 9, 2026 05:29
@github-actions github-actions Bot removed the [Status] Needs Review This PR is ready for review. label Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Premium Analytics [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Plugin] Premium Analytics [Type] Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants